package org.hene;

import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.resource.ContextRelativeResource;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.Model;

public class HomePage extends WebPage {
        private static final long serialVersionUID = 1L;

        private Label label;
        private Label laabel;
        private TextField field;
       
    public HomePage(final PageParameters parameters) {
                //add(new Label("version", getApplication().getFrameworkSettings().getVersion()));
        // TODO Add your page's components here
       
        Form form = new Form("form");
        field = new TextField("field", new Model(""));
        form.add(field);
        form.add(new Button("button") {
                public void onSubmit() {
                        String value = (String)field.getModelObject();
                        label.setDefaultModelObject(value);
                        field.setModelObject("");
                }
        });
        add(form);
        add(label = new Label("message", new Model("")));
        add(new Image("elisaviihdeAd", new PackageResourceReference(HomePage.class, "elisaviihde.jpg")));
        add(new Label("pageTitle", new Model("Testaus sivu")));
    }
   
}

